define(function(require, exports, module) {

	module.exports = {

		fit: function(container, dataWithHeight) {
			var iframe = $("<iframe border='0' style='position:absolute;z-index:-1;left:0;top:0;width:100%;height:100%;'></iframe>").appendTo(container);
			var content = $(iframe.get(0).contentWindow);
			content.on("resize.tablefit", function(e) {
				if(dataWithHeight) {
					dataWithHeight.height = container.height();
				}
			});
			content.triggerHandler("resize.tablefit");
		}
		
	}

});